<template>
	<view class="suiji">
		<view class="text">
			<p>{{words}}</p>
		</view>
		<view class="start" @click="start">
			<text>重新获取</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				words:"",
			}
		},
		
		onLoad() {
				this.start()
		},
		onShareAppMessage(res) {
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			return {
				title: "每天一句至理名言",
				imageUrl: "https://www.leedong.top/img/suangua1.jpg",
		
		
			}
		
		},
		//2.分享到朋友圈
		onShareTimeline() {
		
			return {
				title: "每天一句至理名言",
				imageUrl: "https://www.leedong.top/img/suangua1.jpg",
		
		
			}
		},
		methods: {
			start(){
				this.$api.suijiyulu().then((res)=>{
					
					  this.words=res.data
					// console.log(res)
				})
			}
		}
	}
</script>

<style lang="scss">
	.suiji {
		width: 100%;
		text-align: center;
		.text{
			    font-size: 42rpx;
			    margin: 20px;
				p{
					user-select: all;
				}
		}

		.start {
			width: 100%;
			text-align: center;

			text {
				width: 120px;
				display: inline-block;
				background-color: #e32616;
				font-size: 30rpx;
				color: #fff;
				padding: 10px;
				border-radius: $uni-border-radius-base;
				line-height: 15px;
				margin-top: 20px;
			}

		}

	}
</style>
